03. Notebooks and Workspaces

Jupyter Notebooks

In this program, we'll be using a tool called Jupyter Notebooks. Basically, a notebook is a web application that allows you to combine explanatory text, math equations, code, and visualizations all in a single document.

Here's what they look like:

Code cells

As you can see in the video above, you can enter code into a cell in the notebook. You can then run that cell (either by clicking the run button as shown above, or by pressing Shift + Enter). When you run a code cell, the output will be displayed below the cell.

Notice that you can change the type of any cell to either Code cell or Markdown cell.

Markdown cells

Markdown cells are used for displaying explanations, images, equations, and so on, as shown below. Like the name implies, you can use markdown to format the text in these cells.

Workspaces

In this program, we'll be running all of the Jupyter Notebooks inside Workspaces here in your classroom, so you don't need to install anything on your computer. Here's a workspace with a Jupyter Notebook inside it, so that you can try it out for yourself:

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter
  • Opened files (when workspace is loaded): n/a

⚠️ Important note

In the lower left corner of your notebook, you'll see there is a Menu button. If you click on this, you'll see an option to Reset Data (or sometimes Get New Content).

If you're having trouble with your workspace or have simply made changes you don't like and want to reset back to the way it was when you started, you can use this option—but be careful. Resetting the Workspace means you will lose any code you've been working on. And importantly, each course has a single shared workspace, so resetting a workspace can reset notebooks on other pages within the same course.

So if you have code you're working on that you want to save, we recommend that you make a local copy on your computer. You can either copy and paste your code, or you can download your entire notebook by going to File > Download as.

Jupyter Graffiti

Some of the Jupyter notebooks in this course have a special additional feature called Jupyter Graffiti. Among other things, Graffiti makes it possible to provide audio walkthroughs of the code provided in the notebook. You'll see an example of a Jupyter Graffiti notebook on the next page, which includes some audio walkthroughs to show you how it works. Be sure to check it out!

Note that some web browsers (including Brave and Safari) may be unable to handle the audio playback in Graffiti. Try it out on the next page and, if you are unable to hear the walkthrough, then try using Chrome or Firefox.